<template>
  <div class="info">
    <div class="top">
      <h1>{{ photolist.title }}</h1>
    <p>
      <span>发表时间：{{ photolist.add_time }}</span>
      <span>点击次数：{{ photolist.click }}</span>
    </p>
    </div>
    <!-- 缩略图 -->
    <div class="main">{{ photolist.content }}</div>
    <cmt-box></cmt-box>

  </div>
  <!-- <cmt-box></cmt-box> -->
</template>
<script>
import comment from "../subcomponents/comment.vue";

export default {
  data(){
    return{
      id : this.$route.params.id,
      // title : this.$route.params.title,
      // msg: this.$route.params.message,
      // message : this.$router.push({path:'/home/photoinfo/this.id',query:{message:JSON.stringify(this.message)}}),
      // msg: JSON.stringify(this.$route.params.message),
      // msg : this.$route.params.message,
      msg: JSON.parse(this.$route.params.message),
      photolist : {

      },
    }
  },
  created(){
    // alert(this.id);
    // console.log(this.msg);
    // console.log(this.id)
    this.getPhotoInfo();
  },
  methods: {
    getPhotoInfo(){
      // this.photolist = JSON.stringify(this.$route.params.message);
      this.photolist = JSON.parse(this.$route.params.message);
    }
  },
  components: {
    // 注册 评论子组件
    "cmt-box": comment
  }
}
</script>
<style scoped>
.info{
  padding: 5px;
}
  .info h1{
    font-size: 16px;
  }
  .info p{
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
  }
  .info p span{
    justify-content: space-between;
  }
  .info div{
    padding: 10px;
    border-bottom: 1px solid gray;
  }
</style>


